// components/prdItem/index.wxml.js
const app=getApp()
Component({
  // options: {
  //   multipleSlots: true // 在组件定义时的选项中启用多slot支持
  //   },
  /**
   * 组件的属性列表
   */
  properties: {
    data: {
      type: Object,
      value: {},
      observer: 'handleData'
    },
    classify: {
      type: String,
      value:"1",   //0 是资金 1是项目
    },
    state:{
      type:String,
      value:'2',
      observer: 'statefun'
    }
  },
  /**
   * 组件的初始数据
   */
  data: {
    show:true,
    status:
      {0:'http://image.rzzlq.com/image/090f3a300ec58bb1ab7f1db164d7d2f5.png', //审核未通过
      1:'http://image.rzzlq.com/image/507b677a2c1bfc93be6aa4a8a3c46a13.png', //审核通过
      2:'http://image.rzzlq.com/image/230d9859539a5743651f72e23f4eb358.png'}, //审核中
    
    },
 
  /**
   * 组件的方法列表
   */
  methods: {
    statefun(){
      
    },
    handleData(){
      
    },
    getprojectinfos(){
      wx.navigateTo({
        url: `/pages/itemDetail/index?ac=${this.data.classify}&id=${this.data.data.id}`,
      })
    },
    editproject(){
     
      if(this.data.classify=='0'){
           wx.navigateTo({
        url: `/pages/addFunds/index?id=${this.data.data.id}`,
      })
      }else{
        wx.navigateTo({
          url: `/pages/addProject/index?id=${this.data.data.id}`,
        })
      }
   
    },
    projectDetailPage(){

      if (this.data.state=='2') {
        console.log(this.data.data)
        console.log(this.data.data.id)
        wx.navigateTo({
          url: `/pages/projectDetail/index?pn=${this.data.data.projectName}&id=${this.data.data.id}`,
        })
      } else {
        // wx.navigateTo({
        //   url: `/pages/taskDetail/index?pn=${this.data.data.project_name}&tn=${this.data.data.task_info.maintain_sub_name}&tid=${this.data.data.task_info.id}&pid=${this.data.data.id}`,
        // })
        console.log(this.data.data)
        wx.navigateTo({
          url: `/pages/taskDetail/index?task_data=${encodeURIComponent(JSON.stringify(this.data.data))}`,
        })
      }
      
    },
    acceptTaskPage(){
      wx.navigateTo({
        url: `/pages/canvas/index?pn=${this.data.data.projectName}&id=${this.data.data.projectId}&task_id=${this.data.data.id}&is_desc=${this.data.data.doTaskDesc}&do_type=2&project_id=${this.data.data.projectId}&maintainId=${this.data.data.maintainId}`,
      })
    },
    refuseTaskPage(){
      wx.navigateTo({
        url: `/pages/canvas/index?pn=${this.data.projectName}&id=${this.data.id}`,
      })
    },
    
  }
})
